define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'user.manag_account/index',
        add_url: 'user.manag_account/add',
        edit_url: 'user.manag_account/edit',
        delete_url: 'user.manag_account/delete',
        export_url: 'user.manag_account/export',
        modify_url: 'user.manag_account/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                toolbar: ['refresh'],
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: 'id',search: false},
                    {field: 'username', title: '账号'},
                    // {field: 'password', title: 'password'},
                    // {field: 'status', title: 'status', templet: ea.table.switch},
                    {field: 'create_time', title: '注册时间',search: false},
                    {
                        width: 250,
                        title: '操作',
                        templet: ea.table.tool,
                        operat: [
                           'delete'
                        ]
                    }

                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});